package com.ruoyi.xh.service.impl;

import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.xh.mapper.XhOrderInvoiceMapper;
import com.ruoyi.xh.domain.XhOrderInvoice;
import com.ruoyi.xh.service.IXhOrderInvoiceService;

/**
 * 订单发票Service业务层处理
 * 
 * @author songjw
 * @date 2024-12-13
 */
@Service
public class XhOrderInvoiceServiceImpl extends ServiceImpl<XhOrderInvoiceMapper,XhOrderInvoice> implements IXhOrderInvoiceService {

    /**
     * 查询订单发票
     * 
     * @param id 订单发票主键
     * @return 订单发票
     */
    @Override
    public XhOrderInvoice selectXhOrderInvoiceById(Long id)
    {
        return this.getById(id);
    }

    /**
     * 查询订单发票列表
     * 
     * @param xhOrderInvoice 订单发票
     * @return 订单发票
     */
    @Override
    public Page<XhOrderInvoice> selectXhOrderInvoiceList(XhOrderInvoice xhOrderInvoice)
    {
        return new Page<>();
    }

    /**
     * 新增订单发票
     * 
     * @param xhOrderInvoice 订单发票
     *
     */
    @Override
    public void insertXhOrderInvoice(XhOrderInvoice xhOrderInvoice)
    {
        this.save(xhOrderInvoice);
    }

    /**
     * 修改订单发票
     * 
     * @param xhOrderInvoice 订单发票
     *
     */
    @Override
    public void updateXhOrderInvoice(XhOrderInvoice xhOrderInvoice)
    {
        this.updateById(xhOrderInvoice);
    }

    /**
     * 批量删除订单发票
     * 
     * @param ids 需要删除的订单发票主键
     *
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void deleteXhOrderInvoiceByIds(Long[] ids)
    {
        this.removeByIds(Stream.of(ids).collect(Collectors.toSet()));
    }
}
